package com.xxx.mapper;/**
 * @author zhanzhongxin
 * @date 2021/8/13 13:48
 * @version v1.0
 * @description
 */

import com.xxx.pojo.User;
import com.xxx.sql.UserSqlBuilder;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

/**
 * @Description:
 */
public interface UserMapper {

    @Select("select * from user where id = #{id}")
    @Results({
            @Result(column = "id", property = "id"),
            @Result(column = "name", property = "name"),
            @Result(column = "age", property = "age")
    })
    public User queryUserById(int id);

    @SelectProvider(type = UserSqlBuilder.class, method = "buildGetUsersByName")
    public User queryUserByByName(String name);
}
